﻿#pragma once
#include <glm/glm.hpp>

#include "../../Core/TimeStep.hpp"
#include "../../Event/EventManager.h"

namespace Kriko
{
    class GameController
    {
    public:
        GameController(class Camera* camera);

    public:
        void OnKeyEvent(IEventDataPtr eventPtr);
        void OnMouseMove(IEventDataPtr eventPtr);
        void OnMouseButton(IEventDataPtr eventPtr);
        
        void Update(const TimeStep& deltaTime);

        void SetControlStatePtr(bool* state) { bCanControl = state; }
    private:
        static float fCameraSpeed;
        bool bFirstMouse;
        bool *bCanControl;
        glm::vec2 lastMousePosition;
        glm::vec2 mousePosition;
        float fSpeed;
        class Camera* pCamera;
        int keyCodeArray[348] = {0};
        int mouseButtonArray[3] = {0};
    };
}
    